using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Profile;
using System.Configuration;

namespace ClickSocial.Framework
{
    public class PerfilComun: ProfileBase
    {
        [SettingsAllowAnonymous(false)]
        public virtual bool UsaPrecio
        {
            get
            {
                return Convert.ToBoolean(this.GetPropertyValue("UsaPrecio"));
            }
            set
            {
                this.SetPropertyValue("UsaPrecio", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        public virtual long Espacio
        {
            get
            {
                return Convert.ToInt64(this.GetPropertyValue("Espacio"));
            }
            set
            {
                this.SetPropertyValue("Espacio", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        public virtual string Nombre
        {
            get
            {
                return Convert.ToString(this.GetPropertyValue("Nombre"));
            }
            set
            {
                this.SetPropertyValue("Nombre", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        public virtual string Apellido
        {
            get
            {
                return Convert.ToString(this.GetPropertyValue("Apellido"));
            }
            set
            {
                this.SetPropertyValue("Apellido", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        public virtual string Telefono
        {
            get
            {
                return Convert.ToString(this.GetPropertyValue("Telefono"));
            }
            set
            {
                this.SetPropertyValue("Telefono", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        public virtual string Celular
        {
            get
            {
                return Convert.ToString(this.GetPropertyValue("Celular"));
            }
            set
            {
                this.SetPropertyValue("Celular", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        public virtual string Direccion
        {
            get
            {
                return Convert.ToString(this.GetPropertyValue("Direccion"));
            }
            set
            {
                this.SetPropertyValue("Direccion", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        public virtual string Ciudad
        {
            get
            {
                return Convert.ToString(this.GetPropertyValue("Ciudad"));
            }
            set
            {
                this.SetPropertyValue("Ciudad", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        public virtual string Provincia
        {
            get
            {
                return Convert.ToString(this.GetPropertyValue("Provincia"));
            }
            set
            {
                this.SetPropertyValue("Provincia", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        public virtual string Pais
        {
            get
            {
                return Convert.ToString(this.GetPropertyValue("Pais"));
            }
            set
            {
                this.SetPropertyValue("Pais", value);
            }
        }

        [SettingsAllowAnonymous(false)]
        [SettingsSerializeAs(SettingsSerializeAs.Binary)]        
        public virtual Cart Carrito
        {
            get
            {
                return (Cart)this.GetPropertyValue("Carrito");
            }
            set
            {
                this.SetPropertyValue("Carrito", value);

            }
        }
    }

    
    [Serializable]    
    public class Cart
    {
        public DateTime Creado;
        public DateTime UltimoIngreso;
        public List<CartItem> CartItems = new List<CartItem>();

    }

    [Serializable]
    public class CartItem
    {
        protected long _EventoID;
        protected string _Archivo;
        protected double _Precio;
        protected int _TipoCart;// 1=comprar 0=pedido

        public long EventoID
        {
            get { return _EventoID; }
            set { _EventoID = value; }
        }
        public string Archivo
        {
            get { return _Archivo; }
            set { _Archivo = value; }
        }
        public double Precio
        {
            get { return _Precio; }
            set { _Precio = value; }
        }
        public int TipoCart
        {
            get { return _TipoCart; }
            set { _TipoCart = value; }
        }

        public CartItem(long eventoId, string archivo, double precio, int tipoCart)
        {
            _EventoID = eventoId;
            _Archivo = archivo;
            _Precio = precio;
            _TipoCart = tipoCart;
        }
    }

    
}
